﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using St.DAL;
using St.MODLD;

namespace Supermarket
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnlogin_Click(object sender, EventArgs e)
        {
            string name = tBxuser.Text;
            string pass = tBxpass.Text;
            AdminService ads = new AdminService();
            
            AdminInfo admin = ads.Login(name, pass);
            if (admin == null)
            {
                MessageBox.Show("登录失败,用户名或者密码错误");
            }
            else
            {
                string msg = string.Format(@"登录成功,您的用户信息如下:
管理员编号:{0}
管理员名称:{1}
管理员状态:{2}", admin.AdminId, admin.AdminName,admin.State);
                MessageBox.Show(msg);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
